﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;
using System.Linq;
using System.Data.Linq;
using WX.WMS.DataModel;
using WX.WMS.Common;
using WX.WMS.BLL;

public partial class NQ_Select_Products_Window : PageBase
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            searchDand();
        }

    }
    protected void searchButton_Click(object sender, ImageClickEventArgs e)
    {
        string strKey = "";
        strKey = Key.Text.ToString();
        Response.Redirect(string.Format("NQ_Select_Products_Window.aspx?action=search&Key={0}", strKey));


    }

    protected void searchDand()
    {
        ProductBLL BllProduct = new ProductBLL();
       object key= Request.QueryString["Key"];
       if (key != null && key != "")
       {
           BllProduct.AddLikeCondition("Name", key.ToString());
       }
       SearchResult.DataSource = BllProduct.GetProductList().ToList();
        SearchResult.DataBind();
    }


    protected void SearchResult_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {        
        string ID=SearchResult.DataKeys[e.RowIndex]["ID"].ToString();

        Jscript.CloseWindowReturnValues(ID);
        return;

    }




    protected void SearchResult_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        this.SearchResult.PageIndex = e.NewPageIndex;
        searchDand();
    }
}
